home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / SERIALP_.{98 < prev    next >
Text File  |  1999-09-17  |  3KB  |  120 lines

  1. /*
  2.  * Private header file for the (dumb) serial driver
  3.  *
  4.  * Copyright (C) 1997 by Theodore Ts'o.
  5.  * 
  6.  * Redistribution of this file is permitted under the terms of the GNU 
  7.  * Public License (GPL)
  8.  */
  9.  
  10. #ifndef _LINUX_SERIALP_H
  11. #define _LINUX_SERIALP_H
  12.  
  13. /*
  14.  * This is our internal structure for each serial port's state.
  15.  * 
  16.  * Many fields are paralleled by the structure used by the serial_struct
  17.  * structure.
  18.  *
  19.  * For definitions of the flags field, see tty.h
  20.  */
  21.  
  22. #include <linux/termios.h>
  23. #include <linux/tqueue.h>
  24.  
  25. /*
  26.  * Counters of the input lines (CTS, DSR, RI, CD) interrupts
  27.  */
  28. struct async_icount {
  29.     __u32    cts, dsr, rng, dcd, tx, rx;
  30.     __u32    frame, parity, overrun, brk;
  31.     __u32    buf_overrun;
  32. };
  33.  
  34. struct serial_state {
  35.     int    magic;
  36.     int    baud_base;
  37.     int    port;
  38.     int    irq;
  39.     int    flags;
  40.     int    hub6;
  41.     int    type;
  42.     int    line;
  43.     int    xmit_fifo_size;
  44.     int    custom_divisor;
  45.     int    count;
  46.     unsigned short    close_delay;
  47.     unsigned short    closing_wait; /* time to wait before closing */
  48.     struct async_icount    icount;    
  49.     struct termios        normal_termios;
  50.     struct termios        callout_termios;
  51.     struct async_struct *info;
  52. };
  53.  
  54. struct async_struct {
  55.     int            magic;
  56.     int            port;
  57.     int            hub6;
  58.     int            flags;
  59.     int            xmit_fifo_size;
  60.     struct serial_state    *state;
  61.     struct tty_struct     *tty;
  62.     int            read_status_mask;
  63.     int            ignore_status_mask;
  64.     int            timeout;
  65.     int            quot;
  66.     int            x_char;    /* xon/xoff character */
  67.     int            close_delay;
  68.     unsigned short        closing_wait;
  69.     unsigned short        closing_wait2;
  70.     int            IER;     /* Interrupt Enable Register */
  71.     int            MCR;     /* Modem control register */
  72.     unsigned long        event;
  73.     unsigned long        last_active;
  74.     int            line;
  75.     int            blocked_open; /* # of blocked opens */
  76.     long            session; /* Session of opening process */
  77.     long            pgrp; /* pgrp of opening process */
  78.     unsigned char         *xmit_buf;
  79.     int            xmit_head;
  80.     int            xmit_tail;
  81.     int            xmit_cnt;
  82.     struct tq_struct    tqueue;
  83.     struct wait_queue    *open_wait;
  84.     struct wait_queue    *close_wait;
  85.     struct wait_queue    *delta_msr_wait;
  86.     struct async_struct    *next_port; /* For the linked list */
  87.     struct async_struct    *prev_port;
  88. };
  89.  
  90. #define SERIAL_MAGIC 0x5301
  91. #define SSTATE_MAGIC 0x5302
  92.  
  93. /*
  94.  * The size of the serial xmit buffer is 1 page, or 4096 bytes
  95.  */
  96. #define SERIAL_XMIT_SIZE 4096
  97.  
  98. /*
  99.  * Events are used to schedule things to happen at timer-interrupt
  100.  * time, instead of at rs interrupt time.
  101.  */
  102. #define RS_EVENT_WRITE_WAKEUP    0
  103.  
  104. /*
  105.  * Multiport serial configuration structure --- internal structure
  106.  */
  107. struct rs_multiport_struct {
  108.     int        port1;
  109.     unsigned char    mask1, match1;
  110.     int        port2;
  111.     unsigned char    mask2, match2;
  112.     int        port3;
  113.     unsigned char    mask3, match3;
  114.     int        port4;
  115.     unsigned char    mask4, match4;
  116.     int        port_monitor;
  117. };
  118.  
  119. #endif /* _LINUX_SERIAL_H */
  120.